package com.emperor.mapper;

import com.emperor.anno.AutoFill;
import com.emperor.dto.PartnerSaveDto;
import com.emperor.entity.Partner;
import com.emperor.enumeration.OperationType;
import com.emperor.vo.PartnerIdVo;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

@Mapper
public interface PartnerMapper {

    void updatePwd(Integer id, String newPassword);

    @AutoFill(OperationType.INSERT)
    void save(Partner partner);

    List<Partner> findAll(String name);

    PartnerIdVo getPartnerById(Integer id);

    @AutoFill(OperationType.UPDATE)
    void updatePartner(Integer id, Partner dto);

    @Delete("delete from  tb_partner where id = #{id}")
    void deletePartner(Integer id);

    Integer count();
}
